package com.btpj.blog_server.mapper;

import com.btpj.blog_server.entity.User;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserMapper {

    User getUserById(@Param("id") Long id);

    User getUserByName(@Param("name") String name);

    List<User> getUsersByNickName(@Param("nickName") String nickName);

    int deleteUserRolesByUserId(Long userId);

    int setUserRoles(@Param("roleIds") Long[] roleIds, @Param("userId") Long userId);

    int setUserEnable(@Param("enable") Boolean enable, @Param("userId") Long userId);

    int deleteUserById(@Param("userId") Long userId);

    int updateUserEmail(@Param("userId") Long userId, @Param("email") String email);
}
